﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Fuzzy
{
    public partial class addrecord : Form
    {
        public addrecord()
        {
            InitializeComponent();
        }

        public void setMainForm(main refrence)
        {
            mainform = refrence;
        }

        private void add_Click(object sender, EventArgs e)
        {
            mainform.xmlFile.adddata(this);
        }
        
        
            
        //FUNCTION TO RETURN STRING IN TEXT BOX
        public string text(int x)
        {
            switch (x)
            {
                case 0: return name.Text.ToString();
                    
                case 1: return date.Text.ToString();
                    
                case 2: return opening.Text.ToString();
                    
                case 3: return closing.Text.ToString();
                    
                case 4: return dividend.Text.ToString();
                    
                case 5: return eps.Text.ToString();
                    
                case 6: return grading.Text.ToString();
                    
                case 7: return volume.Text.ToString();
                    
                case 8: return sales.Text.ToString();
                    
                default: return "hello";
                    
            }
        }

        private void back_Click(object sender, EventArgs e)
        {
            this.Hide();
            mainform.Show();
            mainform.BringToFront();
        }

        private void clear_button_Click(object sender, EventArgs e)
        {
            name.Clear();
            date.Clear();
            opening.Clear();
            closing.Clear();
            dividend.Clear();
            eps.Clear();
            grading.Clear();
            sales.Clear();
            volume.Clear();

        }

       
    }
}
